
package com.weed.client.components.statusbar;

import com.weed.client.components.util.SkinPanel;
import com.weed.client.components.util.SkinUtil;

import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JLabel;
import javax.swing.JToolBar;






public class RStatusBar extends SkinPanel
{
       
    JToolBar toolbar = new JToolBar();
    JLabel statusLabel = new JLabel("状态："){ };
    JLabel statusMessageLabel = new JLabel("已连接"){ };
    JLabel messageLabel = new JLabel("消息:"){ };
    JLabel messageContentLabel = new JLabel("消息内容"){
        public Dimension getPreferredSize(){
            Dimension  dim = super.getPreferredSize();
            dim.width +=50;
            return dim;
        }
    };
    JLabel runLabel = new JLabel();
    String statusMessage = new String();
    String message = new String();
    	public RStatusBar()
	{
                super("statusbar");
                toolbar.setOpaque(false);
                toolbar.setBorder(BorderFactory.createEmptyBorder(0, 16, 0, 0));
                toolbar.setFloatable(false);
                this.setLayout(new BorderLayout());
                add(toolbar,BorderLayout.CENTER);
                toolbar.add(statusLabel);
                statusLabel.setIcon(SkinUtil.getImageIcon("images/style_fxy.gif",532,214,549,228));
                toolbar.add(statusMessageLabel);
                toolbar.add(Box.createHorizontalGlue());
                toolbar.add(Box.createVerticalGlue());
                toolbar.addSeparator();
                messageLabel.setIcon(SkinUtil.getImageIcon("images/style_fxy.gif",573,173,587,189));
                toolbar.add(messageLabel);
                toolbar.add(messageContentLabel);
                toolbar.addSeparator();
                toolbar.add(runLabel);
                stop();
                
       }
       public void start(){
            runLabel.setIcon(SkinUtil.getImageIcon("images/016.gif"));
            
       }
       public void stop(){
            runLabel.setIcon(SkinUtil.getImageIcon("images/016.gif",true));
            
       }
}
